package org.sems.sems.Mapper;

import org.apache.ibatis.annotations.Delete;
import org.sems.sems.entity.Aidhjlk;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface AidhjlkMapper {

    /** 插入一条对话记录 */
    int insert(Aidhjlk record);

    /** 查询某用户最近 N 条对话（按时间倒序） */
    List<Aidhjlk> selectRecentByUser(
            @Param("twz") String twz,
            @Param("limit") int limit
    );
    @Delete("delete from aidhjlk where TWZ = #{twz} and TWZFDM = #{twzsfdm}")
    int clearHistory(@Param("twz") String twz,@Param("twzsfdm") int twzsfdm);
}
